
cc.Class({
    extends: cc.Component,

    properties: {
        StartBtn: cc.Button,
        titleAnimation: cc.Animation,
        pageViewNode: cc.Node,
    },

    onLoad() {
        cc.tween(this.node)
            .by(1, { position: cc.v2(0, -cc.winSize.height) }, { easing: "elasticIn" })
            .call(() => {
                this.titleAnimation.play("titleMove");
                this.titleAnimation.on("finished", function () {
                    this.titleAnimation.play("title");
                }, this)
            })
            // .call(this.test.bind(this))
            .start()
        //点击事件
        this.StartBtn.node.on("click", this.onStartBtn, this);
    },


    start() {

    },

    onStartBtn(event, id) {

        //调用pageView节点中函数，保存pageView索引到
        this.pageViewNode.getComponent("RolePageView").pageViewClick();
        cc.director.loadScene("Game");



    },
    // test() {
    //     this.titleAnimation.play("titleMove");
    // }


});
